package com.hdax.dm.controller;

import com.hdax.dm.entity.base.DmImage;
import com.hdax.dm.service.DmImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ImageController {

    @Value("${server.port}")
    private String port;

    @Autowired
    private DmImageService dmImageService;

    @PostMapping("/image/{itemId}")
    DmImage image(@PathVariable("itemId") Long itemId){
        DmImage dmImage = dmImageService.selImageByItemId(itemId);
        return dmImage;
    }

}
